//
//  OptionLayer.m
//  SpeedTap
//
//  Created by Chi Ho Chiu on 20/8/11.
//  Copyright 2011 Individual. All rights reserved.
//

#import "OptionLayer.h"
#import "GameManager.h"

@implementation OptionLayer
@synthesize delegate;

-(id) init
{
    if( (self = [super init]) )
    {
        CGSize winSize = [[CCDirector sharedDirector] winSize];
        
        CCLabelBMFont *font = [CCLabelBMFont labelWithString:@"Option Scene" fntFile:@"Dakota_white_48.fnt"];
        [font setPosition: ccp(winSize.width/2, winSize.height/2)];
        [self addChild:font];
        
        CCLabelBMFont *backFont = [CCLabelBMFont labelWithString:@"Back" fntFile:@"Dakota_white_32.fnt"]; 
        CCMenuItem *backLabel = [CCMenuItemLabel itemWithLabel:backFont target:self selector:@selector(onMenuItemClicked:)];
        
        CCMenu *menu = [CCMenu menuWithItems:backLabel, nil];
        [menu setPosition: ccp( [backLabel contentSize].width/2, [backLabel contentSize].height/2 )];
        
        [self addChild:menu];
    }
    
    return self;
}

-(void) dealloc
{
    [super dealloc];
}

-(void) onMenuItemClicked:(CCMenuItem *)sender
{
    [[GameManager sharedGameManager] replaceScene:kGAME_SCENE_MAIN_MENU];
}

@end
